<%@page import="java.util.List"%>
<%@page import="bizfuse.pac.model.Menu"%>
<%@page import="bizfuse.web.utils.SiteNavigationTagUtils"%>
<%@ page language="java" pageEncoding="UTF-8" contentType="text/html;charset=utf-8" %>
<%@ include file="/common/taglibs.jspf"%>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!--><html lang="zh-cn"> <!--<![endif]-->
<head>
    <%@ include file="/common/header.jspf" %>
    <script type="text/javascript" src="<c:url value='/assets/global/plugins/jquery-slimscroll/jquery.slimscroll.min.js'/>"></script>
	<script type="text/javascript">$.bizfuse = {};$.bizfuse.CONTEXT_URL = "${ctx}";</script>
</head>
<body class="page-header-fixed page-sidebar-fixed-custom">
<div class="page-header navbar navbar-fixed-top">
	<div class="page-header-inner">
		<div class="page-logo">
			<a href="<c:url value='/index.jsp'/>"> 
			<span class="pull-left mgl10">Bizfuse Framework </span></a>
		</div>
		<div class="top-menu">
			<ul class="nav navbar-nav pull-right">
				<li class="dropdown dropdown-user">
					<a href="#" class="dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-close-others="true">
					<span class="username"><i class="fa fa-user"></i> ${currentLoginUser.fullname}</span>
					<i class="fa fa-angle-down"></i>
					</a>
					<ul class="dropdown-menu">
						<li>
							<a href="${ctx}/p/control_panel/uinfo/pword">
							<i class="fa fa-user"></i> 密码修改 </a>
						</li>
						<li>
							<a href="${ctx}/p/control_panel/uinfo/personalInfo">
							<i class="fa fa-user"></i> 个人设置 </a>
						</li>
						<li class="divider">
						</li>
						<li>
							<a href="${ctx}/logout.jsp"><i class="fa fa-key"></i> 退出 </a>
						</li>
					</ul>
				</li>
			</ul>
		</div>
				<div class="hor-menu hor-menu-light hidden-sm hidden-xs">
			<ul class="nav navbar-nav">
<%	
	long siteid = 0L;
	List<Menu> rootMenus = SiteNavigationTagUtils.getCachedRootMenu();
	List<Menu> menus = SiteNavigationTagUtils.getCachedMenuByParentId(0L, rootMenus);
	if(menus != null && menus.size() > 0) {
		for (Menu menu : menus) {
			long menuid = menu.getId();
			if(!SiteNavigationTagUtils.isSelected(menuid, request, rootMenus)) {
			%><li class="classic-menu-dropdown"><%
			} else {
			%><li class="classic-menu-dropdown active"><%
				siteid = menuid;
			}
			%>
			<a href="<%=menu.getLoutinUrl(request)%>">
				<%-- <i class="<%=menu.getIcon() == null || "".equals(menu.getIcon()) ? "fa fa-th-large" : menu.getIcon()%>"></i><%=menu.getTitle()%> --%>
				<%=menu.getTitle()%>
				<i class="fa"></i><span class="selected"></span>
			</a>
			<%
		}
	}
%>
			</ul>
		</div>
		<div class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse">
		</div>
		<div class="menu-toggler responsive-toggler" data-toggle="collapse" data-target=".navbar-collapse">
		</div>
		
	</div>
</div>
<div class="clearfix">
</div>
<div class="page-container">
	<div class="page-sidebar navbar-collapse collapse">
		<ul class="page-sidebar-menu" data-auto-scroll="false" data-auto-speed="200">
			<li class="sidebar-toggler-wrapper">
                <div class="sidebar-toggler">
                </div>
            </li>
			<%-- <li>
				<a href="<c:url value='/index.jsp'/>"><i class="fa fa-home"></i> <span class="title">
				首页 </span></a>
			</li> --%>
<%
	List<Menu> subMenus = SiteNavigationTagUtils.getCachedMenuByParentId(siteid, rootMenus);
	if (subMenus != null && subMenus.size() != 0) {
		for(Menu sub : subMenus) {
			List<Menu> lastMenus = SiteNavigationTagUtils.getCachedMenuByParentId(sub.getId(), rootMenus);
			if(lastMenus != null && lastMenus.size() > 0) {
				if(!SiteNavigationTagUtils.isSelected(sub.getId(), request, rootMenus)) {
				%><li><a href="javascript:void(0);"><i class="<%=sub.getIcon() == null || "".equals(sub.getIcon()) ? "fa fa-th-large" : sub.getIcon()%>"></i><span class="title">
				<%=sub.getTitle()%></span><span class="arrow"></span></a><%
				} else {
				%><li class="start active open"><a href="javascript:void(0);"><i class="<%=sub.getIcon() == null || "".equals(sub.getIcon()) ? "fa fa-th-large" : sub.getIcon()%>"></i>
				<span class="title"><%=sub.getTitle()%></span><span class="arrow open"></span>
				<span class="selected"></span></a><%
				}
			%><ul class="sub-menu"><%
				for(Menu last : lastMenus) {
					if(!SiteNavigationTagUtils.isSelected(last.getId(), request, rootMenus)) {
				%><li><%
					} else {
				%><li class="active"><%		
					}
				%><a href="<%=last.getLoutinUrl(request)%>"><%=last.getTitle()%></a></li><%	
				}
			%></ul>
			</li><%
			} else {
				if(!SiteNavigationTagUtils.isSelected(sub.getId(), request, rootMenus)) {
				%>
					<li>
						<a href="<%=sub.getLoutinUrl(request)%>">
							<i class="<%=sub.getIcon() == null || "".equals(sub.getIcon()) ? "fa fa-th-large" : sub.getIcon()%>"></i>
							<span class="title"><%=sub.getTitle()%></span>
						</a>
					</li>
				<%
				} else {
				%>
					<li class="start active open">
						<a href="<%=sub.getLoutinUrl(request)%>"><i class="<%=sub.getIcon() == null || "".equals(sub.getIcon()) ? "fa fa-th-large" : sub.getIcon()%>"></i>
						<span class="title"><%=sub.getTitle()%></span>
						<span class="selected"></span></a>
					</li>
				<%
				}
			}
		}
	}
%>
		</ul>
	</div>
	<div class="page-content-wrapper">
		<div class="page-content">
<bizfuse:pageContent />
		</div>
	</div>
</div>

   <%@ include file="/common/footer.jspf" %>
</body>